import { baseService } from "@/server/base";

/**
 * 获取图片路径
 * @param code
 * @returns
 */
export const getHttpImageUrl = (code: string) => {
	return import.meta.env.VITE_BASE_URL + `/${code}.png`;
};

/**
 * 将对象转化为url
 * @param obj
 * @returns
 */
export const urlEncode = (obj: Record<string, string>) => {
	let params = Object.keys(obj)
		.map(key => {
			return encodeURIComponent(key) + "=" + encodeURIComponent(obj[key]);
		})
		.join("&");
	return params;
};
